package com.gsn.poker.asset;

import java.util.HashMap;
import java.util.Map;

import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.assets.loaders.resolvers.InternalFileHandleResolver;
import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver;
import com.badlogic.gdx.assets.loaders.resolvers.ResolutionFileResolver.Resolution;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
import com.gsn.engine.gdx.GsnParticleActor;
import com.gsn.engine.gdx.assets.GsnManagerTexture;
import com.gsn.engine.gdx.assets.GsnParticleLoader;

public class FontTexture extends GsnManagerTexture {
	public BitmapFont fontMedium;
	public BitmapFont fontSmall;
	public BitmapFont fontGift;
	public BitmapFont fontGiftDis;

	public BitmapFont loadFont(String file) {
		ParticleEffect effect = new ParticleEffect();
		FileHandle t1 = resolver.resolve(file);
		return new BitmapFont(t1, false);

	}

	public static FontTexture _instance;

	public FontTexture() {
		GsnParticleActor a;
		GsnParticleLoader b;
		resolutions = new Resolution[3];
		resolutions[0] = new Resolution(240, 320, "240320");
		resolutions[1] = new Resolution(320, 480, "320480");
		resolutions[2] = new Resolution(480, 800, "480800");
		resolver = new ResolutionFileResolver(new InternalFileHandleResolver(), resolutions);
		manager = new AssetManager(resolver);
	}

	public static FontTexture inst() {
		if (_instance == null)
			_instance = new FontTexture();
		return _instance;
	}

	@Override
	public void loadTexture() {
		manager.load("font/medium.fnt", BitmapFont.class);
		// manager.load("poker/font/large.fnt", BitmapFont.class);
		manager.load("font/small.fnt", BitmapFont.class);
		manager.load("font/gift.fnt", BitmapFont.class);
		manager.load("font/giftDis.fnt", BitmapFont.class);
	}

	@Override
	public void assignTask() {
		fontMedium = manager.get("font/medium.fnt", BitmapFont.class);

		fontSmall = manager.get("font/small.fnt", BitmapFont.class);
		fontGift = manager.get("font/gift.fnt", BitmapFont.class);
		fontGiftDis = manager.get("font/giftDis.fnt", BitmapFont.class);
	}

}
